package com.turbo.cloud.rule.web.webservice;

import com.turbo.cloud.core.api.R;
import com.turbo.cloud.core.api.Result;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;


/**
 * 图形验证码表 前端控制器
 *
 * @author zhangluning
 */
@Slf4j
@RequiredArgsConstructor
@RestController
public class LiteflowController {

    @Resource
    private FlowExecutor flowExecutor;

    @GetMapping(name = "判断不同性别年龄是否合适", value = "/interface/checkDiffSexOfAgeIsOk")
    public Result checkDiffSexOfAgeIsOk() {
        Map<String, Object> param = new HashMap<>(16);
        param.put("sex", "男");
        param.put("age", 57);

        LiteflowResponse response = flowExecutor.execute2Resp("checkDiffSexOfAgeIsOk", param);
        return R.result(response.getMessage());
    }
}
